package com.giibpt;

import java.util.List;

import com.giibpt.rifidi.EtiquetaActiva;
import com.giibpt.rifidi.RifidiThread;
import com.vaadin.Application;
import com.vaadin.ui.Window;

public class GiibptApplication extends Application {
	
	private static RifidiThread rifidi;
	
	static{
		if(rifidi == null){
			rifidi = new RifidiThread();
			rifidi.start();	
		}
	}
	
	public static List<EtiquetaActiva> getActivos(){
		return rifidi.getActivos();
	}
	
	public static List<EtiquetaActiva> getAlertas(){
		return rifidi.getAlertas();
	}
	@Override
	public void init() {
		setTheme("giibpt");
		//HibernateUtil.get(Alerta.class, 1L);
		/*Window mainWindow = new Window("Giibpt Application");
		Label label = new Label("Hello Vaadin user");
		set
		mainWindow.addComponent(label);*/
		Window w = new GiibptMainWindow();
		setMainWindow(w);
		
	//	setMainWindow(new RastreoWindow());
		
	}

}
